package client.tzstore.oo.dialog

import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.View
import android.view.WindowManager
import client.comm.commlib.R

abstract class BottomDialog : Dialog {

    constructor(context: Context) : super(context, R.style.BottomDialog)

    lateinit var view: View

    abstract fun getV(): View

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(getV())
        window?.apply {
            setGravity(Gravity.BOTTOM)
            setLayout(
                WindowManager.LayoutParams.MATCH_PARENT,
                WindowManager.LayoutParams.WRAP_CONTENT
            )
//            setWindowAnimations(R.style.DialogAnim)
        }
        setCanceledOnTouchOutside(true)

    }
}